import request from "@/request/index.js";

const auth = "auth"; //http://101.42.107.47:30019文档
const base = "base"; //http://101.42.107.47:30020文档

//获取菜单树
export const getMenuListApi = params => {
    return request({
        url: `/api/${base}/api/source/tree`,
        method: "get",
        params
    });
}

//编辑菜单
export const editMenuApi = data => {
    return request({
        url: `/api/${base}/api/source`,
        method: "put",
        data,
    });
}

//新增菜单
export const addMenuApi = data => {
    return request({
        url: `/api/${base}/api/source`,
        method: "post",
        data,
    });
}

//删除菜单
export const delMenuApi = params => {
    return request({
        url: `/api/${base}/api/source`,
        method: "delete",
        params
    });
}

//拖拽排序
export const sortMenuApi = data => {
    return request({
        url: `/api/${base}/api/source/sort`,
        method: "post",
        data
    });
}
